Program optimisation , naturally

نویسندگان

  • Richard Bird
  • Jeremy Gibbons
  • Geraint Jones
چکیده

One of the first things that any functional programmer learns is how to turn the naive quadratic algorithm for reversing a list into a linear-time algorithm by using an accumulating parameter. In this paper we derive another, quite different, linear-time algorithm for reversing a list. The derivation relies on a higherorder naturality [5] property of the function unzip, the function that turns a list of pairs into a pair of lists in the obvious way. The final program uses polymorphic recursion [10], and can be expressed rather neatly using nested datatypes [2]. Although neither feature is an essential component of the fast algorithm, they do simplify it, providing more evidence of the practical utility of these two concepts. Hinze [4] presents another application of these techniques, namely to the problem of computing the bit-reversal permutation of a list. We describe this problem and its solution briefly in Section 6. Indeed, it was Hinze’s application that inspired us to write this paper in the first place. We outline another application in Section 7. Whether or not the technique has wider application remains to be seen.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Modelling of an Agent-based Schedule Optimisation System

This paper introduces a modelling concept which aims at creating an environment which allows the application of global optimisation techniques like Genetic Algorithms in dynamic and complex environments. Such environments are often modelled using multi agent systems. The self-evident drawback of multi agent approaches is that global optimisation techniques are not applicable naturally. The mode...

متن کامل

Geometric Surrogate Model Based Optimisation for Genetic Programming: Initial Experiments

Many real-world problems have expensive objective functions. In continuous optimisation, Surrogate Models (SMs) are often used as components of optimisation algorithms to tackle these types of problems. In previous work, we showed that such approaches can be naturally and rigorously generalised to combinatorial spaces based in principle on any arbitrarily complex underlying solution representat...

متن کامل

Emergency department resource optimisation for improved performance: a review

Emergency departments (EDs) have been becoming increasingly congested due to the combined impacts of growing demand, access block and increased clinical capability of the EDs. This congestion has known to have adverse impacts on the performance of the healthcare services. Attempts to overcome with this challenge have focussed largely on the demand management and the application of system wide p...

متن کامل

Geometric Generalisation of Surrogate Model Based Optimisation to Combinatorial Spaces

In continuous optimisation, Surrogate Models (SMs) are often indispensable components of optimisation algorithms aimed at tackling real-world problems whose candidate solutions are very expensive to evaluate. Because of the inherent spatial intuition behind these models, they are naturally suited to continuous problems but they do not seem applicable to combinatorial problems except for the spe...

متن کامل

Global Supply Chain Management under Carbon Emission Trading Program Using Mixed Integer Programming and Genetic Algorithm

In this paper, the transportation problem under the carbon emission trading program ismodelled by mathematical programming and genetic algorithm. Since green supply chain issuesbecome important and new legislations are taken into account, carbon emissions costs are included inthe total costs of the supply chain. The optimisation model has the ability to minimise the total costsand provides the ...

متن کامل

Semantics of SPARQL under OWL 2 Entailment Regimes

We study the semantics of SPARQL queries with optional matching features under entailment regimes. We argue that the normative semantics may lead to answers that are in conflict with the intuitive meaning of optional matching, where unbound variables naturally represent unknown information. We propose an extension of the SPARQL algebra that addresses these issues and is compatible with any enta...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 1999